#ifndef LOG_H
#define LOG_H

#include <syslog.h>
#include <stdio.h>

#define log_open(x) openlog(x, LOG_PID|LOG_CONS, LOG_USER)
#define log_error(frm, x...) syslog(LOG_ERR, frm, ##x)
#define log_warning(frm, x...) syslog(LOG_WARNING, frm, ##x)
#define log_print(frm, x...) printf(frm"\n", ##x) 
#define log_close() closelog()

#define DEBUG_MODE

#ifdef DEBUG_MODE
#define log_info(frm, x...) syslog(LOG_INFO, frm, ##x)
#else
#define log_info(frm, x...) do {} while (0)
#endif


#endif
